home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / libscsi1.zoo / LibScsi-0.01 / test_rdy.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-14  |  572 b   |  31 lines

  1. /*
  2.  * test_rdy.c - Copyright Steve Woodford, August 1993.
  3.  *
  4.  * Send 'test unit ready' command to SCSI target.
  5.  */
  6.  
  7. #include <sys/types.h>
  8. #include <sys/scsi.h>
  9. #include "libscsi.h"
  10.  
  11.  
  12. PUBLIC  short
  13. Scsi_Test_Unit_Ready(u_char id)
  14. {
  15.     Scsi_Cmd    sc;
  16.  
  17.     if ( id & 0xc0 )
  18.         return(-1);
  19.  
  20.     (void) _Scsi_Timeout( T_Normal(id) );
  21.  
  22.     sc.sc_command = CMD(id, SZ_CMD_TEST_UNIT_READY);
  23.     sc.sc_z[0]    = LUN(id, 0);
  24.     sc.sc_z[1]    = 0;
  25.     sc.sc_z[2]    = 0;
  26.     sc.sc_z[3]    = 0;
  27.     sc.sc_link    = 0;
  28.  
  29.     return ( _Scsi_Command( DMA_READ, &sc, 0L, 0 ) );
  30. }
  31.